import { tokenStore } from '@/store/tokenStore';

const noAuthUrls = [
  '/api/user/wxLogin',
  '/api/user/login',
  '/api/user/register'
];

export const getAuthHeader = (url?: string) => {
  if (url && noAuthUrls.some(noAuthUrl => url.includes(noAuthUrl))) {
    return {};
  }

  const tokenStoreInstance = tokenStore();
  const token = tokenStoreInstance.getToken;
  return token ? { "Authorization": token } : {};
}; 